/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pt.iasd.youthshelter.datamodel;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Rui
 */
@Embeddable
public class ActivityParticipationPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "PATHFINDER_ID")
    private int pathfinderId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ACTIVITY_ID")
    private int activityId;

    public ActivityParticipationPK() {
    }

    public ActivityParticipationPK(int pathfinderId, int activityId) {
        this.pathfinderId = pathfinderId;
        this.activityId = activityId;
    }

    public int getPathfinderId() {
        return pathfinderId;
    }

    public void setPathfinderId(int pathfinderId) {
        this.pathfinderId = pathfinderId;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) pathfinderId;
        hash += (int) activityId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActivityParticipationPK)) {
            return false;
        }
        ActivityParticipationPK other = (ActivityParticipationPK) object;
        if (this.pathfinderId != other.pathfinderId) {
            return false;
        }
        if (this.activityId != other.activityId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pt.iasd.youthshelter.datamodel.ActivityParticipationPK[ pathfinderId=" + pathfinderId + ", activityId=" + activityId + " ]";
    }
    
}
